//package com.ly.mpayment.persist.service.downordermatchshop;
//
//import java.io.Serializable;
//import java.util.List;
//
//import org.springframework.stereotype.Service;
//
//import com.ly.mpayment.persist.entity.DownOrderMatchShop;
//import com.ly.mpayment.persist.service.AbstractService;
//
//import cn.jpush.api.utils.StringUtils;
//@Service
//public class DownOrderMatchShopImpl extends AbstractService<DownOrderMatchShop, Serializable> implements IDownOrderMatchShop {
//
//	@Override
//	public synchronized boolean addDownOrderMatchShop(DownOrderMatchShop shop) {
//		if(shop != null){
////			if(this.findDownOrderMatchShopOne(shop.getDownRechargeFlow().getDownorderuuid(), shop.getUpprouuid()) == null){
//				this.saveOrUpdate(shop);
//				return true;
////			}
//		}
//		return false;
//	}
///op
//	/**
//	 * 查询已经存在的自动匹配产品 切换下一个的条件查询
//	 */
//	@Override
//	public DownOrderMatchShop findDownOrderMatchShopOne(String downUuid, String upProductUUid) {
//		return this.findUnique("select d from DownOrderMatchShop d where d.downRechargeFlow.downorderuuid = ? and d.upprouuid = ? ", downUuid,upProductUUid);
//	}
//	/**
//	 * 查询已经存在的自动匹配产品 切换下一个的条件查询
//	 */
//	@Override
//	public DownOrderMatchShop findDownOrderMatchShop(String downUuid, String upProductUUid) {
//		try {
//			List<DownOrderMatchShop> list = this.find("select d from DownOrderMatchShop d where d.downRechargeFlow.downorderuuid = ? and d.upprouuid = ? and d.autoMatch = 1 ", downUuid,upProductUUid);
//			if(list != null && list.size() > 0){
//				return list.get(0);
//			}
//			return null;
//		} catch (Exception e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//			System.out.println(String.format("downUuid-->%s,upProductUUid--->%s", downUuid,upProductUUid));
//			return null;
//		}
//	}
//
//	@Override
//	public boolean deleteDownOrderMatchShop(String downFlowUUid) {
//		if(!StringUtils.isEmpty(downFlowUUid)){
////			this.deleteByIds(, downFlowUUid);
//			this.deleteHql("delete from DownOrderMatchShop where downRechargeFlow.downorderuuid = '".concat(downFlowUUid.trim()).concat("'"));
//			return true;
//		}
//		return false;
//	}
//
//	@Override
//	public boolean updateDownOrderMatchShop(DownOrderMatchShop shop) {
//		if(shop != null){
//			this.updateEntity(shop);
//			return true;
//		}
//		return false;
//	}
//
//}
